package cd.safe.school.adapter;

import java.util.List;
import java.util.Map;

import android.content.Context;
import android.content.Intent;
import android.sax.StartElementListener;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import cd.safe.school.R;
import cd.safe.school.activity.SchoolSMS;
import cd.safe.school.activity.SchoolSMS_detail;

public class SchoolSMSAdapter2 extends BaseAdapter {
	private List<Map<String, Object>> lists;
	private Context context;

	public SchoolSMSAdapter2(Context context, List<Map<String, Object>> lists) {
		this.context = context;
		this.lists = lists;

	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return lists.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			LayoutInflater in = LayoutInflater.from(context);
			convertView = in.inflate(R.layout.school_sms_item, null);
		}

		TextView person_biaoti = (TextView) convertView
				.findViewById(R.id.person_biaoti);
		TextView time = (TextView) convertView.findViewById(R.id.time);
		TextView person_xinxiji = (TextView) convertView
				.findViewById(R.id.person_xinxiji);
		person_biaoti.setText((CharSequence) lists.get(position).get(
				"person_biaoti"));
		time.setText((CharSequence) lists.get(position).get("time"));
		person_xinxiji.setText((CharSequence) lists.get(position).get(
				"person_xinxiji"));

		return convertView;
	}

}
